<?php
/*
Plugin Name: BPDEV-CORE
Plugin URI: http://bp-dev.org/projects/#core
Description: Adds bpdev core functions
Author: Nicola Greco
Version: 0.3
Author URI: http://nicolagreco.com

Copyright (c) 2009-2011, Nicola Greco (mail: notsecurity@gmail.com | website: http://nicolagreco.com).

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/

define( 'BPDEV_CORE_VERSION' , '0.3' );
define( 'BPDEV_PREFIX_DIR' , 'bpdev-' );

require_once( 'bp-core.php' );
require_once( 'bpdev-core/bpdev-framework.php' );

function bpdev_core_setup_global() {

	global $bp;
	$bp->bpdev->prefix->dir = BPDEV_PREFIX_DIR;
	$bp->bpdev->version = BPDEV_CORE_VERSION;
	$bp->bpdev->prefix->tables = 'bpdev_';

}

function bpdev_component_dir( $component ) {

	global $bp;
	return MUPLUGINDIR . '/' . $bp->bpdev->prefix->dir . $bp->bpdev->{$component}->slug . '/';

}

function bpdev_core_check_component( $component ) {

	global $bp;

	if ( $bp->bpdev->{$component}->version )
		return true;
	else
		return false;

}

add_action( 'init' , 'bpdev_core_setup_global', 3 );
?>